#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 10;
int q,m,n, k;
int t[110],l[110],h[110];

int main()
{
    cin >> q;
    while(q--){
        cin >> n >> m;
        for(int i = 1; i<= n; i++)cin >> t[i] >> l[i] >> h[i];
        int nowl = m,nowh = m;
        int f = 0;
        for(int i = 1; i<= n; i++){
            nowl -= (t[i] - t[i-1]);
            nowh += (t[i] - t[i -1]);
            if(nowl > h[i] || nowh < l[i]){
                cout << "NO\n";
                f = 1;
                break;
            }
            nowl = max(nowl,l[i]);
            nowh = min(nowh,h[i]);
        }
        if(f == 0)cout << "YES\n";
    }
   
   return 0;
}
